1 /*
2 * Angkor Web Framework
3 *
4 * Distributable under LGPL license.
5 * See terms of license at gnu.org.
6 */
7
8 package com.tirsen.angkor.process;
9
10 import com.tirsen.angkor.RenderContext;
11 import com.tirsen.angkor.ViewFactory;
12
13 public class SingleViewFactoryRenderValve extends RenderValve
14 {
15 private ViewFactory factory;
16
17 public SingleViewFactoryRenderValve(ViewFactory factory)
18 {
19 this.factory = factory;
20 }
21
22 protected Pipeline createRenderPipeline()
23 {
24 Pipeline pipeline = super.createRenderPipeline();
25 pipeline.addValve(new DoRenderValve());
26 return pipeline;
27 }
28
29 public void execute(ExecuteContext exec) throws Exception
30 {
31 RenderContext renderContext = (RenderContext) exec.getAttribute(ExecuteContext.RenderContextAttribute);
32 Pipeline subPipeline = createRenderPipeline();
33 ExecuteContext subExec = subPipeline.createExecuteContext(renderContext);
34 subExec.setAttribute(ViewFactoryAttribute, factory);
35 subPipeline.execute(subExec);
36 exec.executeNext();
37 }
38 }
This page was automatically generated by Maven